package my.edu.model.information.entity.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.groups.Default;
import lombok.Data;
import my.edu.common.validate.groups.Insert;
import my.edu.common.validate.IntegerPattern;

import java.math.BigDecimal;

@Data
public class SupplierDTO {

    @Null(message = "id必须为空", groups = Insert.class)
    @NotNull(message = "id不能为空" ,groups = { Default.class})
    private Long id;
    private Long supplierCategoryId;
    @NotBlank(message = "供应商编号不能为空", groups = {Insert.class, Default.class})
    private String supplierNo;
    @NotBlank(message = "供应商姓名不能为空", groups = {Insert.class, Default.class})
    private String supplierName;
    private Long salespersonId;//业务员id
    private String contactPerson;//联系人
    private BigDecimal vatRate;//增值税税率
    private String bankAccount;
    private String bankName;
    private String taxIdentificationNumber;//纳税人识别号
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式错误", groups = {Insert.class, Default.class})
    private String phone;
    private String qqWechat;
    private String contactAddress;//联系地址
    private String remark;
    private BigDecimal payableBalance;//应付余额
    @IntegerPattern(regexp = "^[01]$", message = "状态参数错误", groups = {Insert.class, Default.class})
    private Integer status;//状态
    @IntegerPattern(regexp = "^[01]$", message = "是否物流公司参数错误", groups = {Insert.class, Default.class})
    private Integer isLogisticsCompany;//是否物流公司
}
